package com.example.springbootelasticjob.job;

import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class MyJob implements SimpleJob {
    @Override
    public void execute(ShardingContext shardingContext) {
        switch (shardingContext.getShardingItem()) {
            case 0:
                log.info("do something by sharding item 0");
                break;
            case 1:
                log.info("do something by sharding item 1");
                break;
            case 2:
                log.info("do something by sharding item 2");
                break;
            // case n: ...
        }
    }
}
